home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Utilities / MPW Extras / Scripts / ToggleSelectionMarker < prev   
Encoding:
Text File  |  1991-07-29  |  905 b   |  28 lines  |  [TEXT/MPS ]

  1. # ToggleSelectionMarker - drop marker/selection intervening text script
  2.  
  3. # determine the toggle state by searching for a marker called "TogSel"
  4. Set MarkerOn 0                # initialize
  5. For Name in `Markers "{Active}"`
  6.     If "{Name}" == TogSel
  7.         Set MarkerOn 1        # signal marker has been dropped
  8.         Break
  9.     End  # If
  10. End  # For Name
  11.  
  12. If {MarkerOn}
  13.     # the start marker has already been dropped.
  14.     # save the current window position
  15.     # drop an end marker at the current insertion point.
  16.     # select the intervening text
  17.     # delete the TogSel marker
  18.     # restore the original window position
  19.     Set SavePos "`FAccess -s "{Active}" ≥≥ Dev:Null`"
  20.     Find §:TogSel "{Active}" ∑∑ Dev:Null
  21.     Unmark TogSel "{Active}" ∑∑ Dev:Null
  22.     ScrollTool -T {SavePos} "{Active}"
  23. Else  # If MarkerOn
  24.     # drop the marker TogSelStart at the current insertion point
  25.     Mark -y § "TogSel" "{Active}" ∑∑ Dev:Null
  26. End  # If MarkerOn
  27.  
  28. # end of ToggleSelectionMarker